package com.tao.poly_.detail_;

public class Polydetail03 {
    public static void main(String[] args) {
        BB bb = new BB();
        System.out.println(bb instanceof BB);
        System.out.println(bb instanceof AA);

        AA aa = new BB();
        System.out.println(aa instanceof AA);
        System.out.println(aa instanceof BB);
        //判断aa的运行类型是否为后面的类型 或者 后面类型的子类型

        Object obj = new Object();
        System.out.println(obj instanceof AA);//false

        String str = "abc";
        System.out.println(str instanceof Object);
    }
}

class AA{}
class BB extends AA{}
